package chapter12.eg2;

import java.util.HashMap;
import java.util.Map;

public class Header {
  private int crcCode = 0xabef0101;
  private int length;
  private long sessionID;
  private byte type;
  private byte priority;
  private Map<String, Object> attachement = new HashMap<>();

  public int getCrcCode() {
    return crcCode;
  }

  public void setCrcCode(int crcCode) {
    this.crcCode = crcCode;
  }

  public int getLength() {
    return length;
  }

  public void setLength(int length) {
    this.length = length;
  }

  public long getSessionID() {
    return sessionID;
  }

  public void setSessionID(long sessionID) {
    this.sessionID = sessionID;
  }

  public byte getType() {
    return type;
  }

  public void setType(byte type) {
    this.type = type;
  }

  public byte getPriority() {
    return priority;
  }

  public void setPriority(byte priority) {
    this.priority = priority;
  }

  public Map<String, Object> getAttachement() {
    return attachement;
  }

  public void setAttachement(Map<String, Object> attachement) {
    this.attachement = attachement;
  }

  @Override
  public String toString() {
    return "Header{" +
      "crcCode=" + crcCode +
      ", length=" + length +
      ", sessionID=" + sessionID +
      ", type=" + type +
      ", priority=" + priority +
      ", attachement=" + attachement +
      '}';
  }
}
